#include "common.h"
/*
int tohex(short n) {
    int hex = 0;
    hex = (n / 16) * 10 + (n ^ 16);
    return hex;
}
void tohexstr(const char *src, size_t src_len, char *dst, size_t dst_len) {
    int j = 0;
    for (int i = 0, j = 0; i < src_len; i++) {
        short d = tohex((short) src[i]);
        dst[j] = (char) ((d & 0xF0) + '0');
        dst[j+1] = (char) ((d & 0x0F) + '0');
        j += 2;
    }
    dst[j] = '\0';
}

void hexdump(const char *bytes, const size_t len, const char *msg) {
    char buffer[128];
    printf("%s:\n", msg);
    printf("addr\t\thex\t\tASCII\n");
    size_t hex_len = 128;
    tohexstr(bytes, len, buffer, hex_len);
    printf("hex string:\n%s\n", buffer);
}
*/
int main(int argc, char **argv) {
    char text[] = "The quick fox jumps over the lazy dog.!";
    printf("text is '%s'\n", text);
    hexdump(text, strlen(text), "text");
    return 0;
}
